<template>
  <div class="container">
    <div class="">
      <ul class="company-num-list box mb30">
        <li class="flex">
          <div class="li-top">访问量</div>
          <div>{{info.trafficCount}}</div>
        </li>
        <li class="flex">
          <div class="li-top">所有用户</div>
          <div>{{info.totalUserCount}}</div>
        </li>
        <li class="flex">
          <div class="li-top">今日新增用户</div>
          <div>{{info.todayNewUserCount}}</div>
        </li>
      </ul>
      <ul class="company-num-list box mb30">
        <li class="flex">
          <div class="li-top">每日签约</div>
          <div>{{info.daySigning}}</div>
        </li>
        <li class="flex">
          <div class="li-top">每周签约</div>
          <div>{{info.weekSigning}}</div>
        </li>
        <li class="flex">
          <div class="li-top">每月签约</div>
          <div>{{info.monthSigning}}</div>
        </li>
        <li class="flex">
          <div class="li-top">每年签约</div>
          <div>{{info.yearSigning}}</div>
        </li>
      </ul>
    </div>
    <div class="chart-content">
      <ve-histogram :data="chartData"></ve-histogram>
    </div>

  </div>
</template>

<script>
let CONSTANT = require("../../constant/constant.js");
let common = require("../../common.js");
import TableList from "../common/my-table";
export default {
  data() {
    return {
      info: "",
      chartData: {
        columns: ["类型", "预约数量/个"],
        rows: []
      }
    };
  },
  components: {},
  created() {},
  mounted() {
    this.getInfo();
  },
  methods: {
    getInfo: function() {
      let url = CONSTANT.URL.LIST.statistics;
      let data = "";
      common.get(url, data, res => {
        let data = res.data.bussData;
        this.info = data;
        this.chartData.rows = [
          { "类型": "预约 50to100", "预约数量/个": data.booking50To100Count },
          { "类型": "预约 100to150", "预约数量/个": data.booking100To150Count},
          { "类型": "预约 150to200", "预约数量/个": data.booking150To200Count },
          { "类型": "预约 gt200", "预约数量/个": data.bookingGT200Count },
          { "类型": "预约 lt50", "预约数量/个":data.bookingLT50Count }
        ];
      });
    }
  }
};
</script>

<style lang="scss">
.container {
  .company-num-list {
    li {
      cursor: pointer;
      height: 123px;
      background-color: #fff;
      box-shadow: 2px 2px 1px rgba(15, 5, 9, 0.1);
      border-left: 1px solid rgba(15, 5, 9, 0.1);
      margin-right: 1.3%;
      text-align: center;
      border-radius: 10px;
      margin-top: 25px;
      .li-top {
        height: 44px;
        font-size: 16px;
        color: #ffffff;
        line-height: 44px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
      }
      div:nth-child(2) {
        font-size: 40px;
        line-height: 83px;
        color: #000000;
      }
    }
    li:nth-child(1) {
      div:nth-child(1) {
        background: linear-gradient(to right, #838efe, #00e9ff);
      }
    }
    li:nth-child(2) {
      div:nth-child(1) {
        background: linear-gradient(to right, #ff5454, #ffa0a0);
      }
    }
    li:nth-child(3) {
      div:nth-child(1) {
        background: linear-gradient(to right, #d6a615, #e6d7a9);
      }
    }
    li:nth-child(4) {
      div:nth-child(1) {
        background: linear-gradient(to right, #f47721, #f8b88b);
      }
    }
    li:nth-child(5) {
      div:nth-child(1) {
        background: linear-gradient(to right, #547cff, #a0caff);
      }
    }
    li:nth-child(6) {
      div:nth-child(1) {
        background: linear-gradient(to right, #55df3e, #b6ffaa);
      }
    }
  }
  .chart-content {
    margin-top: 30px;
    background-color: #fff;
    padding-top: 60px;
    .ve-histogram {
      margin: 0 auto;
      width: 70% !important;
    }
  }
  .user-num {
    color: #409eff;
    cursor: pointer;
  }
}
</style>
